Description
Two glamour preview theming bugs:
- Table cell padding and border glyphs (โ โผ โ) rendered with no background โ fell back to the terminal-default bg, mismatching the theme paper (worse across themes). Inline-code cells also showed dark blocks.
- H1 heading background bar only painted the prefix/suffix margins, not behind the heading text โ the word sat on paper bg because applyTheme forced the Text background to paper, overriding the H1 block bg for the heading's child text.
Fix (internal/preview/preview.go): applyTheme now clears all backgrounds and sets only Document/Code/CodeBlock/Table = paper, leaving Text bg unset so heading text inherits the H1 heading bg. Added fillBackground() to re-assert paper bg after every ANSI reset and at line starts, so unstyled gaps (borders, padding) render on paper. Applied to the theme-driven styles only.
Acceptance Criteria
- #1 H1 heading background fills behind the heading text, not just the margins
- #2 Table cell padding and borders render on the theme paper across all themes
- #3 Inline code in cells uses paper bg (no dark blocks)
- #4 Regression tests cover H1 bg and post-reset paper re-assert
Implementation Notes
Follow-up: real-terminal bleed where unstyled regions adopted the TERMINAL bg (cream-over-dark / dark-over-light). Root: glamour/viewport emit bare \x1b[m resets and viewport padding added AFTER Render. Fixed by re-asserting paper after bare resets too and moving fillBackground to View(). Also left Text.Color unset so H1 text is legible (uses legibleText on the heading bar). 2 more tests. (commit qkvsmknk)